//
//  highScoreScreen.m
//  whack
//
//  Created by aneuman1 on 11/7/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "highScoreScreen.h"
//#import "mainMenuScreen.h"

@implementation highScoreScreen
@synthesize winner1, winner2, winner3;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)dealloc
{
    [super dealloc];
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    
    scores = [[NSUserDefaults standardUserDefaults] objectForKey:@"highScores"];
    
    [super viewDidLoad];
 
    if(![[NSUserDefaults standardUserDefaults] boolForKey:@"firstRun"]) {
        //do initialization stuff here...
        [[NSUserDefaults standardUserDefaults] setObject:[NSArray arrayWithObjects:@"0", @"0", @"0", nil] forKey:@"highScores"];

        [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"firstRun"];
    }

        winner3.text = [scores objectAtIndex:0];

        winner2.text = [scores objectAtIndex:1];

        winner1.text = [scores objectAtIndex:2];

}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

/*
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
*/

-(IBAction)readHomeButtonPressed {
   
    [self.parentViewController dismissModalViewControllerAnimated: YES];
}

- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{
    return ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight));
}

@end
